import React from 'react';
import DataService from './DataService.js';

class ListComponents extends React.Component{


	constructor(props){
		super(props);
		this.userList = [];
		this.state ={
			load:0
		};
		
	}
	componentDidMount(){
		this.userList = DataService.getInstance().getUserService().getUserList();
		this.setState({})
	}
	getItemList(){
		return this.userList.map((user)=>{
				return (<li key={user.id}>{user.firstName}</li>);
		});
	}

	render (){
		return (
				<div>
					<h3>列表</h3>
					<ul>{this.getItemList()}</ul>
				</div>
			);
	}
}

export default ListComponents;